/*
 * Multiphase.h
 *
 *  Created on: 23 Jul 2011
 *      Author: Allan
 */

#ifndef MULTIPHASE_H_
#define MULTIPHASE_H_

// C++ includes
#include <iostream>
#include <memory>
#include <vector>
using namespace std;

// GeoReact includes
#include "Phase.h"
#include "Utils/SpeciesMap.h"
#include "Utils/Types.h"

class Multiphase 
{
public:
	Multiphase();
	
	Multiphase(const vector<Phase>& phases);
	
	const unsigned GetNumPhases() const;
	
	const unsigned GetNumSpecies() const;
	
	const vector<Phase>& GetPhases() const;
	
	const vector<string>& GetSpecies() const;
	
	const SpeciesMap& GetSpeciesMap() const;
	
	const Phase& GetPhase(const string& phasename) const;
	
	const Index operator[](const string& species) const;
	
	const vector<Index> operator[](const vector<string>& species) const;
	
	const VectorXd ActivityCoefficients(double T, double P, const VectorXd& n) const;
	
	const VectorXd Activities(double T, double P, const VectorXd& n) const;
	
private:
	/// The phases in the multiphase system
	vector<Phase> phases;
	
	/// The union of all the species in the system
	vector<string> species;
	
	/// The species map object that stores the indexes of the species
	SpeciesMap speciesMap;
};

ostream& operator<<(ostream& out, const Multiphase& multiphase);

#endif /* MULTIPHASE_H_ */
